<template>
    <el-container>
      <el-header>
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b">
          <el-menu-item index="1">处理中心</el-menu-item>
          <el-submenu index="2">
            <template slot="title">我的工作台</template>
            <el-menu-item index="2-1">选项1</el-menu-item>
            <el-menu-item index="2-2">选项2</el-menu-item>
            <el-menu-item index="2-3">选项3</el-menu-item>
            <el-submenu index="2-4">
              <template slot="title">选项4</template>
              <el-menu-item index="2-4-1">选项1</el-menu-item>
              <el-menu-item index="2-4-2">选项2</el-menu-item>
              <el-menu-item index="2-4-3">选项3</el-menu-item>
            </el-submenu>
          </el-submenu>
          <el-menu-item index="3" disabled>消息中心</el-menu-item>
          <el-menu-item index="4"><a href="https://www.ele.me" target="_blank">订单管理</a></el-menu-item>
        </el-menu>
      </el-header>
      <el-container>
        <el-aside>
          <el-menu
            default-active="/home/university"
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            router
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b">
            <el-submenu index="/">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>基础录入</span>
              </template>
              <el-menu-item-group>
                <el-menu-item index="/home/university">学校管理</el-menu-item>
                <el-menu-item index="/home/major">专业管理</el-menu-item>
                <el-menu-item index="/home/course">课程管理</el-menu-item>
                <el-menu-item index="/home/trainingplan">培养方案管理</el-menu-item>
                <el-menu-item index="/home/semester">学期管理</el-menu-item>
                <el-menu-item index="/home/planCourse">主干课程</el-menu-item>
                <el-menu-item index="/home/planMajorinfo">专业信息</el-menu-item>
                <el-menu-item index="/home/planTrainingtarget">培养目标</el-menu-item>
                <el-menu-item index="/home/teaching">教学计划</el-menu-item>
                <el-menu-item index="/home/coursetypeinfo">课程体系架构</el-menu-item>
              </el-menu-item-group>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
</template>

<script>
export default {
  name: 'Home',
  data () {
    return {
      activeIndex: '1'
    }
  },
  created () {
  },
  computed: {
  },
  methods: {
    handleSelect (key, keyPath) {
      console.log(key, keyPath)
    },
    handleOpen (key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose (key, keyPath) {
      console.log(key, keyPath)
    }
  }
}
</script>

<style scoped>
  .el-header {
    padding: 0;
  }
  .el-aside {
    width: 220px !important
  }
  .el-main {
    padding: 0;
    padding-left: 20px;
  }
</style>
